<%namespace name="include" file="/admin/base/include.html" />
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf8" />
<title>无标题文档</title>
${include.jquery()}
${include.bootstrap()}
${include.validationEngine()}
<style type="text/css">
<!--
body {
	margin-left: 0px;
	margin-top: 0px;
	margin-right: 0px;
	margin-bottom: 0px;
}
.STYLE1 {font-size: 12px}
.STYLE3 {font-size: 12px; font-weight: bold; }
.STYLE4 {
	color: #03515d;
	font-size: 12px;
}
.CURSOR {cursor:pointer}
-->
</style>
</head>
<body>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td height="30" background="/static/admin/images/tab/tab_05.gif"><table width="100%" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td width="12" height="30"><img src="/static/admin/images/tab/tab_03.gif" width="12" height="30" /></td>
        <td><table width="100%" border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td width="46%" valign="middle"><table width="100%" border="0" cellspacing="0" cellpadding="0">
              <tr>
                <td width="5%"><div align="center"><img src="/static/admin/images/tab/tb.gif" width="16" height="16" /></div></td>
                <td width="95%" class="STYLE1"><span class="STYLE3">你当前的位置</span>：[${request.params['menu1']}]-[${request.params['menu2']}]</td>
              </tr>
            </table></td>
            <td width="54%"><table border="0" align="right" cellpadding="0" cellspacing="0">
              <tr>
                <td width="60"><table width="90%" border="0" cellpadding="0" cellspacing="0">
                  <tr style="cursor:pointer;" id="btnsearch">
                    <td class="STYLE1"><div align="center"><img src="/static/admin/images/tab/search.png" width="14" height="14" /></div></td>
                    <td class="STYLE1"><div align="center">查询</div></td>
                  </tr>
                </table></td>

                <td width="60"><table width="90%" border="0" cellpadding="0" cellspacing="0">
                  <tr style="cursor:pointer;" id="btnadd">
                    <td class="STYLE1"><div align="center"><img src="/static/admin/images/tab/22.gif" width="14" height="14" /></div></td>
                    <td class="STYLE1"><div align="center">新增</div></td>
                  </tr>
                </table></td>
                <td width="52"><table width="88%" border="0" cellpadding="0" cellspacing="0">
                  <tr style="cursor:pointer;" id="btndelete">
                    <td class="STYLE1"><div align="center"><img src="/static/admin/images/tab/11.gif" width="14" height="14" /></div></td>
                    <td class="STYLE1"><div align="center">删除</div></td>
                  </tr>
                </table></td>
              </tr>
            </table></td>
          </tr>
        </table></td>
        <td width="16"><img src="/static/admin/images/tab/tab_07.gif" width="16" height="30" /></td>
      </tr>
    </table></td>
  </tr>
  <tr>
    <td><table width="100%" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td width="8" background="/static/admin/images/tab/tab_12.gif">&nbsp;</td>
        <td><table id="datatable" width="100%" border="0" cellpadding="0" cellspacing="1" bgcolor="b5d6e6">
          <tr>
            <td width="3%" height="22" background="/static/admin/images/tab/bg.gif" bgcolor="#FFFFFF"><div align="center">
              <input type="checkbox" name="checkbox" value="checkbox" id="chkAll"/>
            </div></td>
            <td width="10%" height="22" background="/static/admin/images/tab/bg.gif" bgcolor="#FFFFFF"><div align="center"><span class="STYLE1">login</span></div></td>
            <td width="10%" height="22" background="/static/admin/images/tab/bg.gif" bgcolor="#FFFFFF"><div align="center"><span class="STYLE1">商家名称</span></div></td>
            <td width="10%" height="22" background="/static/admin/images/tab/bg.gif" bgcolor="#FFFFFF"><div align="center"><span class="STYLE1">店主</span></div></td>
            <td width="10%" height="22" background="/static/admin/images/tab/bg.gif" bgcolor="#FFFFFF"><div align="center"><span class="STYLE1">特色</span></div></td>
            <td width="10%" height="22" background="/static/admin/images/tab/bg.gif" bgcolor="#FFFFFF"><div align="center"><span class="STYLE1">手机</span></div></td>
            <td width="10%" height="22" background="/static/admin/images/tab/bg.gif" bgcolor="#FFFFFF"><div align="center"><span class="STYLE1">qq</span></div></td>
            <td width="10%" height="22" background="/static/admin/images/tab/bg.gif" bgcolor="#FFFFFF"><div align="center"><span class="STYLE1">验证</span></div></td>
            <td width="10%" height="22" background="/static/admin/images/tab/bg.gif" bgcolor="#FFFFFF"><div align="center"><span class="STYLE1">状态</span></div></td>
            <td width="10%" height="22" background="/static/admin/images/tab/bg.gif" bgcolor="#FFFFFF" class="STYLE1"><div align="center">基本操作</div></td>
          </tr>
          %for user in businessusers.object_list:
          <tr>
            <td height="20" bgcolor="#FFFFFF"><div align="center">
            <input type="checkbox" name="checkbox2" value="checkbox" id="chkSingle${user.id}"/>
            </div></td>
            <td height="20" bgcolor="#FFFFFF"><div align="center"><span class="STYLE1">${user.login}</span></div></td>
            <td height="20" bgcolor="#FFFFFF"><div align="center"><span class="STYLE1">${user.companyname}</span></div></td>
            <td height="20" bgcolor="#FFFFFF"><div align="center"><span class="STYLE1">${user.contactname}</span></div></td>
            <td height="20" bgcolor="#FFFFFF"><div align="center"><span class="STYLE1">${user.special}</span></div></td>
            <td height="20" bgcolor="#FFFFFF"><div align="center"><span class="STYLE1">${user.contacttel}</span></div></td>
            <td height="20" bgcolor="#FFFFFF"><div align="center"><span class="STYLE1">${user.qq}</span></div></td>
            <td height="20" bgcolor="#FFFFFF"><div align="center"><span class="STYLE1">${user.checked and u'验证' or u'未验证'}</span></div></td>
            <td height="20" bgcolor="#FFFFFF"><div align="center"><span class="STYLE1">${user.enable and u'激活' or u'禁用'}</span></div></td>
            <td height="20" bgcolor="#FFFFFF">
            <div align="center">
                <span class="STYLE4">
                    <span class="CURSOR" id="edit_${user.id}"><img src="/static/admin/images/tab/edt.gif" width="16" height="16"/>编辑</span>&nbsp; &nbsp;
                    <span class="CURSOR" id="delete_${user.id}"><img src="/static/admin/images/tab/del.gif" width="16" height="16"/>删除</span>
                </span>
            </div>
            </td>
          </tr>
          %endfor
        </table></td>
        <td width="8" background="/static/admin/images/tab/tab_15.gif">&nbsp;</td>
      </tr>
    </table></td>
  </tr>
  <tr>
    <td height="35" background="/static/admin/images/tab/tab_19.gif"><table width="100%" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td width="12" height="35"><img src="/static/admin/images/tab/tab_18.gif" width="12" height="35" /></td>
        <td><table width="100%" border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td class="STYLE4">&nbsp;&nbsp;共有 ${businessusers.count} 条记录，当前第 ${businessusers.current_index}/${businessusers.pagecount} 页</td>
            <td><table border="0" align="right" cellpadding="0" cellspacing="0">
                <tr>
                    <td width="40"><a href="${businessusers.get_page_url(request.url, 1)}"><img src="/static/admin/images/tab/first.gif" width="37" height="15"/></a></td>
                    %if businessusers.hasprevious:
                    <td width="45"><a href="${businessusers.get_page_url(request.url, businessusers.previous)}"><img src="/static/admin/images/tab/back.gif" width="43" height="15"/></a></td>
                    %endif
                    %if businessusers.hasnext:
                    <td width="45"><a href="${businessusers.get_page_url(request.url, businessusers.next)}"><img src="/static/admin/images/tab/next.gif" width="43" height="15"/></a></td>
                    %endif
                    <td width="40"><a href="${businessusers.get_page_url(request.url, businessusers.pagecount)}"><img src="/static/admin/images/tab/last.gif" width="37" height="15" /></a></td>
                  <td width="100"><div align="center"><span class="STYLE1">转到第
                    <input name="textfield" type="text" size="4" style="height:12px; width:20px; border:1px solid #999999;" id="gotopage"/> 
                    页 </span></div></td>
                  <td width="40"><img src="/static/admin/images/tab/go.gif" width="37" height="15" class="CURSOR" id="goto"/></td>
                </tr>
            </table></td>
          </tr>
        </table></td>
        <td width="16"><img src="/static/admin/images/tab/tab_20.gif" width="16" height="35" /></td>
      </tr>
    </table></td>
  </tr>
</table>
<script>
var highlightcolor='#c1ebff';
var nocolor='#ffffff'; 
var  clickcolor='#51b2f6';
$(document).ready(function(){
    $('#searchform').validationEngine();
    $('#datatable tr').mouseover(function(){
        $(this).children('td').each(function(){
            if($(this).attr('bgcolor') != clickcolor)
                $(this).attr('bgcolor', highlightcolor);
        });
    })
    $('#datatable tr').mouseout(function(){
        $(this).children('td').each(function(){
            if($(this).attr('bgcolor') != clickcolor)
                $(this).attr('bgcolor', nocolor);
        });
    })
    $('#datatable tr').click(function(){
        $('#datatable tr td').each(function(){
            $(this).attr('bgcolor', nocolor);
        })
        $(this).children('td').each(function(){
            $(this).attr('bgcolor', clickcolor);
        });
    })
    $('#btnadd').click(function(){
        window.location="edit.html?role=${request.params.get('role')}&menu1=${request.params.get('menu1')}&menu2=${request.params.get('menu2')}";
    })
    $('[id^=delete_]').click(function(){
        if(confirm("确定删除这条记录吗?"))
        {
            var id = $(this).attr('id').replace('delete_','');
            window.location='${request.url}'.replace('list.html', 'delete.html') + '&id=' + id;
        }
    })
    $('#btndelete').click(function(){
        var chkboxs = $('input[id^=chkSingle]:checked');
        if(chkboxs.length==0)
        {
            alert('请至少选择一条记录!');
        }
        else
        {
            if(confirm("确定删除这些记录吗?"))
            {
                var ids = '';    
                chkboxs.each(function(){
                    ids = ids + $(this).attr('id').replace('chkSingle','') + ',';
                })
                window.location='${request.url}'.replace('list.html', 'delete.html') + '&id=' + ids;
            }
        }
    })
    $('#btnsearch').click(function(){
        $('#trsearch').toggle();
    })
    $('[id^=edit_]').click(function(){
        var id = $(this).attr('id').replace('edit_','');
        window.location='${request.url}'.replace('list.html', 'edit.html') + '&id=' + id;
    })
    $('#chkAll').click(function(){
        if($(this).attr('checked'))
        {
            $('[id^=chkSingle]').attr('checked', true);
        }
        else
        {
            $('[id^=chkSingle]').attr('checked', false);
        }
    })
    $('#goto').click(function(){
        window.location = '${businessusers.get_page_url(request.url, "[page]")}'.replace('[page]',$('#gotopage').val());
    })
})
</script>
</body>
</html>
